#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
double get(double x, double y)
{
	return 2018 * pow(x, 4) + 21 * x + 5 * pow(x, 3) + 5 * pow(x, 2) + 14;
}
int main()
{
	int t;
	cin >> t;
	while (t--) {
		double y;
		cin >> y;
		double l = 0;
		double r = 100;
		double mid = 0;
		if (y < 14 || get(100, y) < y) {
			cout << -1 << endl;
			continue;
		}
		while (r - l > 0.00001) {
			mid = (l + r) / 2;
			if (get(mid ,y) >= y) {
				r = mid;
			}
			else {
				l = mid;
			}
		}
		printf("%.4lf\n", l);
	}
	return 0;
}